/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package MetricsRetriever.RetrieverComponents;

import DataStructures.Metrics;
import DataStructures.ProjectInformation;
import General.FileManager;
import General.Globals;
import General.RequestMaker;
import java.util.ArrayList;

/**
 *
 * @author Manuel
 */
public class JavaManager implements MetricsManager{

    private ProjectInformation projectInfo;
    private Metrics projectMetrics;
    private FileManager fManager;

    public JavaManager(ProjectInformation i,FileManager fm){
        this.projectInfo = i;
        fManager = fm;
    }

    public Metrics getAllCodeMetrics(){
        String file = RequestMaker.storeFile(projectInfo.getArchieveLink().getName(), Globals.DATA_DIRECTORY+"/"+projectInfo.getName());
        fManager = new FileManager(projectInfo.getName());
        ArrayList<String> fileList = fManager.process(file);
        projectMetrics = this.assessMetrics(fileList);

        //fManager.cleanUp();
        return projectMetrics;
    }

    private Metrics assessMetrics(ArrayList<String> files){
        Metrics m = new Metrics();
        //TODO implement
        
        return m;
    }



}
